/**
 * Created by dower on 2016/11/29 0029.
 */
var time_url = '';
var handle_func = function () {};
var pre_handle = function () {};
$(function(){
    var now_date = $('#mydate').text();
    var now_year = (now_date.split('-'))[0];
    $('#mydate').monthpicker({
        years: [2016,2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026, 2027, 2028, 2029, 2030],
        topOffset: 6,
        my_now_date:now_date,
        my_now_year:now_year,
        onMonthSelect: function(m, y) {
            pre_handle();
            m = String(m+1);
            if(m.length==1) m = '0'+m;
            var valueText = y+'-'+m;
            //获取当前时间的数量
            $.getJSON(time_url,{date:valueText},function(data){
                handle_func(valueText,data);
            });
        }
    });
});